
import jcolibri.casebase.LinealCaseBase;
import jcolibri.cbraplications.StandardCBRApplication;
import jcolibri.cbrcore.Attribute;
import jcolibri.cbrcore.CBRCase;
import jcolibri.cbrcore.CBRCaseBase;
import jcolibri.cbrcore.CBRQuery;
import jcolibri.cbrcore.Connector;
import jcolibri.connector.OntologyConnector;
import jcolibri.datatypes.Instance;
import jcolibri.exception.ExecutionException;
import jcolibri.exception.OntologyAccessException;
import jcolibri.method.retrieve.RetrievalResult;
import jcolibri.method.retrieve.NNretrieval.NNConfig;
import jcolibri.method.retrieve.NNretrieval.NNScoringMethod;
import jcolibri.method.retrieve.NNretrieval.similarity.global.Average;
import jcolibri.method.retrieve.NNretrieval.similarity.local.Equal;
import jcolibri.method.retrieve.NNretrieval.similarity.local.ontology.OntCosine;
import jcolibri.method.retrieve.NNretrieval.similarity.local.ontology.OntDeep;
import jcolibri.method.retrieve.NNretrieval.similarity.local.ontology.OntDeepBasic;
import jcolibri.method.retrieve.NNretrieval.similarity.local.ontology.OntDetail;
import jcolibri.method.retrieve.selection.SelectCases;
import java.util.ArrayList;

public class CBRAppTest
{

    /**
	 * Main test for local loop cycle 
	 */
	public static void main(String[] args) {
        try {
        
        ArrayList<Double> weights = new ArrayList<Double>();
        double[] _weights = {0.5 , 0.6 ,0.7 ,0.8 ,0.9, 0.1 ,0.3  };
        for (int i=0;i<_weights.length;i++) {
          weights.add(_weights[i]);
        }
        
        CBRApp test = new CBRApp();
        test.init();
        
        TwisterDescription queryDesc = new TwisterDescription(); 
        queryDesc.setTemperature(new Instance("HIGH_TEMPERATURE"));
        queryDesc.setPressureDynamic(new Instance("PRESSURE_STABLE"));
        queryDesc.setOvercast(new Instance("OVERCAST_CUMULUS"));
        queryDesc.setLocation(new Instance("RUSSIA"));
        queryDesc.setHumidity(new Instance("HIGH_HUMIDITY"));
        queryDesc.setDayTime(new Instance("DAY"));
        queryDesc.setAtmosphericFronts(new Instance("COLD_WARM_FRONTS"));
        
        ArrayList<UISolutionDescription> result = test.query(queryDesc,weights);
        
 
        System.out.println("Test1");
        for (int i=0;i<result.size();i++)
            System.out.println(result.get(i).toString());
            
        queryDesc = new TwisterDescription(); 
        queryDesc.setTemperature(new Instance("HIGH_TEMPERATURE"));
        queryDesc.setPressureDynamic(new Instance("PRESSURE_RISE"));
        queryDesc.setOvercast(new Instance("OVERCAST_CUMULUS"));
        queryDesc.setLocation(new Instance("UKRAINE"));
        queryDesc.setHumidity(new Instance("HIGH_HUMIDITY"));
        queryDesc.setDayTime(new Instance("DAY"));
        queryDesc.setAtmosphericFronts(new Instance("COLD_FRONT"));    
            
        result = test.query(queryDesc,weights);
        
 
        System.out.println("Test2");
        for (int i=0;i<result.size();i++)
            System.out.println(result.get(i).toString());
        
        
        test.close();
        
        
        }  catch (OntologyAccessException e) {
			System.out.println(e.getMessage());
			e.printStackTrace();
		}
        
		
	}

}